﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<GabageFactory.Models.Modification_apply>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	申请修改数据
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% using (Html.BeginForm("Create", "Modification", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {%>
        <%= Html.ValidationSummary(true) %>
        <%= Html.HiddenFor(model => model.id) %>
    
    <table cellpadding="4" cellspacing="0" class="com_detail_table" style="width:756px; font-size:13px;">
        <tr>
            <td class="lab" style="width:110px;"><strong>申请类型：</strong></td>
            <td>
                <input type="radio" name="type" <%if (Model.type == 1){ %>checked="checked"<%} %> value="1" id="simple" onclick="applySimpleChange();" />申请修改少量历史数据
                <input type="radio" name="type" <%if (Model.type == 2){ %>checked="checked"<%} %> value="2" id="missed" onclick="applyMissedChange();" style="margin-left:20px" />申请历史数据的补录
                <%= Html.ValidationMessageFor(model => model.type) %>
            </td>
        </tr>
        <tr>
            <td class="lab"><strong>申请标题：</strong></td>
            <td>
                <%= Html.TextBoxFor(model => model.title, new { style = "width:280px" })%>
                <%= Html.ValidationMessageFor(model => model.title) %>
            </td>
        </tr>
        <tr>
            <td class="lab"><strong>申请内容：</strong></td>
            <td>
                <textarea name="content" cols="50" rows="14" id="contentSimple">
上报数据时间：________
堆场/尾矿库名称：________________________________
修改数据内容：（格式：水位及水质－1号调节水池水位）
原上报数据：________________________________
现上报数据：________________________________
修改原因：________________________________
责任人：________

（以上为固定格式，若一次修改多个数据，请将以上内容复制）
                </textarea>
                <textarea name="content" cols="50" rows="14" id="contentMissed" style="display:none" disabled="disabled">
上报数据时间：________
堆场/尾矿库名称：________________________________
补录数据数量：________________________________
修改原因：________________________________
责任人：________

（请将附件需要补录的数据用红色标识）
                </textarea>
                <%= Html.ValidationMessageFor(model => model.content) %>
            </td>
        </tr>
        <tr id="missedFile" <%if (Model.type == 1){ %>style="display:none"<%} %>>
            <td class="lab"><strong>补录数据：</strong></td>
            <td>
                <input type="file" name="file" />
                <%= Html.ValidationMessageFor(model => model.file) %>
            </td>
        </tr>

    </table>

    <div class="submit_btn_area" style="margin-left:122px;">
        <input type="submit" value="提 交" />
    </div>

    <% } %>

    <script type="text/javascript" language="javascript">
        function applySimpleChange() {
            $("#missedFile").css("display", "none");
            $("#contentSimple").css("display", "");
            document.getElementById("contentSimple").disabled = false;
            $("#contentMissed").css("display", "none");
            document.getElementById("contentMissed").disabled = true;
        }

        function applyMissedChange() {
            $("#contentSimple").css("display", "none");
            document.getElementById("contentSimple").disabled = true;
            $("#contentMissed").css("display", "");
            document.getElementById("contentMissed").disabled = false;
            $("#missedFile").css("display", "");
        }
    </script>
</asp:Content>
